#include "askwindow.h"

#include <QPushButton>
#include <QIcon>
#include <QLabel>
#include <QPixmap>
#include <QTextEdit>
#include <QFont>

AskWindow::AskWindow(QWidget *parent)
    : QMainWindow{parent}
{
    this->setWindowTitle("学生管理系统");
    this->setWindowIcon(QIcon(":/Picture/Picture/windowTitle.png"));
    this->setFixedSize(600,800);
    QLabel *backgroundLabel = new QLabel;
    backgroundLabel->setFixedSize(600,800);
    QPixmap backgroundPixmap(":/Picture/Picture//background.png");
    backgroundLabel->setPixmap(backgroundPixmap.scaled(backgroundLabel->size(), Qt::KeepAspectRatio));
    this->setCentralWidget(backgroundLabel);
    //创建对话框以传达提示信息
    QTextEdit* textEdit = new QTextEdit(this);
    textEdit->setReadOnly(true); // 设置文本框为只读
    textEdit->setGeometry(70, 50, 460, 200); // 设置位置和大小
    textEdit->setPlainText("请选择所需功能！"); // 设置初始文本
    textEdit->setStyleSheet("QTextEdit { background: transparent;"
                            "border: 2px solid #000000; " //设置边框为2像素宽，黑色
                            "border-radius: 5px; " // 设置边框圆角半径
                            "transition: background-color 0.3s ease; " //添加过渡效果 }"); //设置文本框透明
                            "}");
    QFont font;
    font.setPointSize(18); // 设置字体大小
    font.setFamily("华文新魏"); // 设置字体族
    textEdit->setFont(font); //应用字体到文本框
    //添加功能：展示某学生基础信息、展示某班级基础信息、展示某学生考勤情况、展示某班级某日考勤、查询某科目应缴费用、查询某学生应缴费用
    QPushButton * showStudentText = new QPushButton("展示某学生基础信息",this);
    showStudentText->setFixedSize(240,60);
    showStudentText->move(180,270);
    showStudentText->setFont(font);
    showStudentText->setStyleSheet("QPushButton { "
                               "background-color: transparent; " //设置背景色为透明
                               "border: 2px solid #000000; " //设置边框为2像素宽，黑色
                               "border-radius: 5px; " // 设置边框圆角半径
                               "transition: background-color 0.3s ease; " //添加过渡效果
                               "}"
                               "QPushButton:hover { "
                               "background-color: #ADD8E6; " //鼠标悬停时设置背景色为浅蓝色
                               "}");
    QPushButton * showClassText = new QPushButton("展示某班级基础信息",this);
    showClassText->setFixedSize(240,60);
    showClassText->move(180,360);
    showClassText->setFont(font);
    showClassText->setStyleSheet("QPushButton { "
                               "background-color: transparent; " //设置背景色为透明
                               "border: 2px solid #000000; " //设置边框为2像素宽，黑色
                               "border-radius: 5px; " // 设置边框圆角半径
                               "transition: background-color 0.3s ease; " //添加过渡效果
                               "}"
                               "QPushButton:hover { "
                               "background-color: #ADD8E6; " //鼠标悬停时设置背景色为浅蓝色
                               "}");
    QPushButton * showStudentDaily = new QPushButton("展示某学生考勤情况",this);
    showStudentDaily->setFixedSize(240,60);
    showStudentDaily->move(180,450);
    showStudentDaily->setFont(font);
    showStudentDaily->setStyleSheet("QPushButton { "
                               "background-color: transparent; " //设置背景色为透明
                               "border: 2px solid #000000; " //设置边框为2像素宽，黑色
                               "border-radius: 5px; " // 设置边框圆角半径
                               "transition: background-color 0.3s ease; " //添加过渡效果
                               "}"
                               "QPushButton:hover { "
                               "background-color: #ADD8E6; " //鼠标悬停时设置背景色为浅蓝色
                               "}");
    QPushButton * showClassDaily = new QPushButton("展示某班级某日考勤",this);
    showClassDaily->setFixedSize(240,60);
    showClassDaily->move(180,540);
    showClassDaily->setFont(font);
    showClassDaily->setStyleSheet("QPushButton { "
                               "background-color: transparent; " //设置背景色为透明
                               "border: 2px solid #000000; " //设置边框为2像素宽，黑色
                               "border-radius: 5px; " // 设置边框圆角半径
                               "transition: background-color 0.3s ease; " //添加过渡效果
                               "}"
                               "QPushButton:hover { "
                               "background-color: #ADD8E6; " //鼠标悬停时设置背景色为浅蓝色
                               "}");
    QPushButton * askSubjectGain = new QPushButton("查询某科目应缴费用",this);
    askSubjectGain->setFixedSize(240,60);
    askSubjectGain->move(180,630);
    askSubjectGain->setFont(font);
    askSubjectGain->setStyleSheet("QPushButton { "
                               "background-color: transparent; " //设置背景色为透明
                               "border: 2px solid #000000; " //设置边框为2像素宽，黑色
                               "border-radius: 5px; " // 设置边框圆角半径
                               "transition: background-color 0.3s ease; " //添加过渡效果
                               "}"
                               "QPushButton:hover { "
                               "background-color: #ADD8E6; " //鼠标悬停时设置背景色为浅蓝色
                               "}");
    QPushButton * askStudentGain = new QPushButton("查询某学生应缴费用",this);
    askStudentGain->setFixedSize(240,60);
    askStudentGain->move(180,720);
    askStudentGain->setFont(font);
    askStudentGain->setStyleSheet("QPushButton { "
                               "background-color: transparent; " //设置背景色为透明
                               "border: 2px solid #000000; " //设置边框为2像素宽，黑色
                               "border-radius: 5px; " // 设置边框圆角半径
                               "transition: background-color 0.3s ease; " //添加过渡效果
                               "}"
                               "QPushButton:hover { "
                               "background-color: #ADD8E6; " //鼠标悬停时设置背景色为浅蓝色
                               "}");
}
